﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace NPMonitor.DataModel.Scheduling
{
    [DataContract(Name="Schedule")]
    public class Schedule
    {
        internal Schedule()
        {
        }

        internal Schedule(ISchedule schedule)
        {
            ScheduleType = schedule.GetType().AssemblyQualifiedName;
        }

        internal ISchedule AsInternalSchedule()
        {
            ISchedule schedule = (ISchedule)Helpers.Utils.CreateInstanceWithRequiredInterface(this.ScheduleType, typeof(ISchedule).Name);
            return schedule;
        }

        [DataMember(Name = "ScheduleType", IsRequired = true)]
        public string ScheduleType { get; set; }
    }
}
